/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package be.ugent.medirem.persistence.entity.details;

import be.ugent.medirem.persistence.util.DateFormatter;
import java.util.Date;

/**
 *
 * @author Simon
 */
public class PatientDetails {

    private Long patientId;
    private String username;
    private String firstname;
    private String surname;
    private Date birthDate;
    private String bloodgroup;
    private String socialSecurityNumber;
    private Long locationId;
    private Date lastConsultation;
    private Date nextConsultation;

    public PatientDetails() {
    }

    public PatientDetails(String username, String socialSecurityNumber) {
        this.username = username;
        this.socialSecurityNumber = socialSecurityNumber;
    }

    public PatientDetails(String username, String firstname, String surname) {
        this.username = username;
        this.firstname = firstname;
        this.surname = surname;
    }

    public PatientDetails(Long patientId, String username, String firstname, String surname, Date birthDate, String bloodgroup, String socialSecurityNumber, Long locationId) {
        this.patientId = patientId;
        this.username = username;
        this.firstname = firstname;
        this.surname = surname;
        this.birthDate = birthDate;
        this.bloodgroup = bloodgroup;
        this.socialSecurityNumber = socialSecurityNumber;
        this.locationId = locationId;
    }

    public PatientDetails(Long patientId, String firstname, String surname, Date birthDate, String bloodgroup) {
        this.patientId = patientId;
        this.firstname = firstname;
        this.surname = surname;
        this.birthDate = birthDate;
        this.bloodgroup = bloodgroup;
    }

    public Date getBirthDate() {
        return birthDate;
    }

    public void setBirthDate(Date birthDate) {
        this.birthDate = birthDate;
    }

    public String getBloodgroup() {
        return bloodgroup;
    }

    public void setBloodgroup(String bloodgroup) {
        this.bloodgroup = bloodgroup;
    }

    public String getFirstname() {
        return firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public Long getLocationId() {
        return locationId;
    }

    public void setLocationId(Long locationId) {
        this.locationId = locationId;
    }

    public Long getPatientId() {
        return patientId;
    }

    public void setPatientId(Long patientId) {
        this.patientId = patientId;
    }

    public String getSocialSecurityNumber() {
        return socialSecurityNumber;
    }

    public void setSocialSecurityNumber(String socialSecurityNumber) {
        this.socialSecurityNumber = socialSecurityNumber;
    }

    public String getSurname() {
        return surname;
    }

    public void setSurname(String surname) {
        this.surname = surname;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Date getLastConsultation() {
        return lastConsultation;
    }

    public void setLastConsultation(Date lastConsultation) {
        this.lastConsultation = lastConsultation;
    }

    public Date getNextConsultation() {
        return nextConsultation;
    }

    public void setNextConsultation(Date nextConsultation) {
        this.nextConsultation = nextConsultation;
    }

    public String getName() {
        return this.firstname + " " + this.surname;
    }

    public String toJSON() {
        return "patient:{username:'"+username+"',firstname:'"+firstname+"',lastname:'"+surname+"',ssn:'"+socialSecurityNumber+"',birthdate:'"+DateFormatter.format(birthDate, "dd/MM/yyyy")+"',bloodgroup:'"+bloodgroup+"',id:'"+patientId+"',locationid:'"+locationId+"'}";
    }
}

